<template>
	<view class="">
		<view class="list_box" v-for="(item,index) in businessList" :key="item.store_id" @click="toDetails(item.store_id)">
			<view class="left">
				<!-- <image :src="item.avatar" mode=""></image> -->
			</view>
			<view class="right">
				<view class="title">
					{{item.store_name}}
				</view>
				<view class="group">
					<view class="">
						{{item.group_buying_name1}}
					</view>
					<view class="">
						{{item.group_buying_name2}}
					</view>
					<view class="">
						{{item.group_buying_name3}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: "",
				businessList: []
			}
		},
		methods: {
			getSearch() {
				let result = {
					province: '河北省',
					city: '保定市',
					district: '望都县',
					user_id: 2,
					content: this.keyword
				}
				this.http.post("/search_function_api", result).then(res => {
					this.businessList = res.result
				})
			},
			toDetails(store_id) {
				uni.navigateTo({
					url: `../../page_business/details?store_id=${store_id}`
				})
			}
		},
		onLoad(option) {
			this.keyword = option.keyword
			this.getSearch()
		},
	}
</script>

<style lang="scss">
	.list_box {
		display: flex;
		background-color: pink;
	}
</style>